package com.tledu.mvc02.convert;


import cn.hutool.core.date.DateUtil;
import org.springframework.core.convert.converter.Converter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * 日期类型转换类
 * @author Antg
 * @date 2021/8/12  0:19
 */

public class DateConverter implements Converter<String, Date> {
    @Override
    public Date convert(String s) {
        return DateUtil.parse(s,"yyyy-MM-dd HH:ss:mm");
    }
}
